<div style="border:1px solid #ddd;border-radius:5px;">
    <?php foreach ($data->detail_orders as $value){ ?>
    <div>
    <table style="width:400px;margin:0 auto;font-size: 20px" class="ticket-barcode">
        <tr>
            <td style="text-align:left;padding:20px;color:black">
                <b style="font-size: 20px">
                    <?php
                    $event = Event::model()->with('translate')->findByPk($value->event_id);
                    echo $event->translate[0]->main_title;
                    ?>
                </b>
                <br/>
                    <span style="font-size: 20px">
                        <?php echo $event->translate[0]['sub_title'] ?>
                    </span><br/>
                <br/>
                <?php
                echo date_format(new DateTime($event['start_time']), 'h:i A') . ',' . date_format(new DateTime($event['start_date']), 'd - m , Y');
                ?>
                <br/><?php echo $event->translate[0]['location']; ?>
                <br/>Loại vé:
                <?php
                $ticket = Ticket::model()->findByPk($value->ticket_id);
                echo $ticket->description_of_ticket;
                ?>
                <br/>Giá tiền: <?php echo number_format($value->price); ?>  VNĐ
                <br/>Số ghế: A1
            </td>

        </tr>
        <tr>
            <td colspan=2 style="text-align: center">
                <img src="<?php echo Yii::app()->baseUrl; ?>/barcode.php?code=<?php echo $value->barcode_hash; ?>"/>
                <?php echo $value->barcode_hash; ?>
            </td>
        </tr>
        <tr>
            <td></td>
        </tr>
    </table>
        <a class="print" rel=".ticket-barcode">Print</a>
        </div>
    <?php } ?>
</div>
<script type="text/javascript">
    $(function() {

        $('.print').click(function() {
            $(this).siblings('table').printArea();
            return false;
        });

    });
</script>